<%@ page import="java.io.FileWriter" %>
<%--
  Created by IntelliJ IDEA.
  User: Specter
  Date: 2019/5/5
  Time: 13:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="User.Userjson" %>
<%@ page import="User.UserInfo" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <style>
        body{
            background: url("/css/bg.jpg");
            background-repeat: no-repeat;
            background-size: cover;
            overflow-x: hidden;
        }
        .mess{
            width: 100%;
            height: 30px;
            float: top;
        }
        .mess1{
            width: 250px;
            height: 500px;
            background-color: #ded7d7;
            float: left;
            opacity: 0.85;
            margin-left: -75px;
        }
        .tx{
            width: 100px;
            height: 100px;
            border-radius: 50%;

        }
        .mess2{
            width: 75%;
            height:500px;
            background-color: #ded7d7;
            float: right;
            opacity: 0.85;
            margin-right: 50px;
        }
        .hrLine{
            vertical-align:middle;
            display:inline-block;
        }
    </style>
</head>
<body>
<%
    UserInfo bean=new UserInfo();
    if(session.getAttribute("UserInfo")==null) response.sendRedirect("http://localhost:8080/Login.jsp");
    else{
        bean= (UserInfo)session.getAttribute("UserInfo");
    }
    String a;
    String path=request.getContextPath();
    if(request.getSession().getAttribute("denglu")!=null){
        a="/login/dgut";
    }
    else{
        a="Login.jsp";
    }
    String Path=null;
    Path="css/"+(String) session.getAttribute("path");
    if(Path.equals("css/null"))Path="css/a.jpg";
%>
<div class="mess">
    <h3 style="color: white;float: left;margin-top: 0px;margin-left: 25px;">绿色生活</h3>
    <form  action="<%=a%>" method="post">
        <input type="submit" value="退出" style="float: right;">
    </form>
</div>
<div class="mess1">
    <form action="/upload" method="post" enctype="multipart/form-data">
    <div style="text-align:center;">
        <div style="float: left;">
            <input type="submit" value="上传头像" style="color:blue;border: none;background-color: #ded7d7;" >
        </div>
        <br>
        <div>
        <a href="" title="更换头像">
            <label for="file">
                <img src="<%=Path%>" alt="" class="tx">
            </label>
            <input style="opacity:0;width:0px;color: #ded7d7;" required="required" type="file" id="file" name="file" accept="image/*"><br>
        </a>
        </div>
    </div>
    </form>
    <h4 style="text-align:center;margin-top: 0px;margin-bottom: 0px;"><%=bean.getSurname()%>先生</h4>
    <hr>
    <h3 style="text-align: center;">个人信息</h3>
</div>
<div class="mess2">
    <h2 style="text-align: center;margin-bottom: 0px;">账户设置</h2>
    <h3 style="text-align: center;margin-top: 0px;color:#9a9696; ">管理你的账户信息并设置邮箱</h3>
    <div style=" width:100%; text-align:left; margin-left:15px; margin-right:15px;">
        <hr class="hrLine" style="width:50px;"/>个人信息<hr class="hrLine" style="width:80%;"/>
    </div>
    <form>
        <div style="float: left;margin-left:50px; ">
            <br>
            <div>用户名</div>
            <h4 style="margin-top:0px;"><%=bean.getUsername()%></h4>
            <br><br>
            <div>姓</div>
            <h4 style="margin-top:0px;"><%=bean.getSurname()%></h4>
        </div>
        <div style="float: right;margin-right:300px; ">
            <br>
            <div>邮箱</div>
            <h4 style="margin-top:0px;"><%=bean.getMail()%></h4><br><br>
            <div>名</div>
            <h4 style="margin-top:0px;"><%=bean.getName()%></h4>
        </div>
    </form>
</div>
<script></script>
</body>
</html>
